import { defineConfig } from 'vite'
import vitepressDemo from 'vite-plugin-vitepress-demo'
import { fileURLToPath } from 'url'
import path from 'path'

const baseUrl = fileURLToPath(new URL('.', import.meta.url))

// https://vite.dev/config/
export const baseConfig = defineConfig({
  plugins: [
    vitepressDemo()
  ],
  resolve: {
    alias: [
      {
        find: /^bh-ui/,
        replacement: path.resolve(baseUrl, 'packages/bh-ui/src')
      },
      {
        find: /^@bh-ui\/utils/,
        replacement: path.resolve(baseUrl, 'packages/utils/src')
      }
    ]
  }
})

export default baseConfig
